$(document).ready( function() {
    var textArray = [
        '<p>FXM2U has been helping the Global Trade Forex Group (over 300 traders) for over 2 years FXM2Us in-depth trading knowledge And professional, courteous service enables our group to receive The best forex trading arrangements.<br/><br/><strong>John Parker</strong></p>',
        '<p>One of the best forex broker! Thank you so much! This is how all forex broker should be.<br/><br/><strong>Anonymous</strong></p>',
        '<p>I signed up and made my first trade today. Its so easy and direct. The support staff is super efficient and friendly. Thank you Trade FXM2U! You are really a good broker.<br/><strong>Alice Saw</strong><br/><br><strong>Phoenix, Arizona</strong></p>',
        '<p>I will be with you for a long time! Thank you for all the great support.<br/><br/><strong>Anonymous</strong></p>',
        '<p>I have been trading for several years and over that time I have purchased many trading related products most of which have not lived up to my expectations. In comparison, I have found the tools that I have purchased from FXM2U to be of a high professional quality: I strongly believe that these tools have given me the edge that I needed to succeed in the market.<br/><br/><strong>Christina Ghiringhelli</strong></p>',
        '<p>I have been trading for the last 4 years and now I have found the best ever trading system. FXM2U helped me make many time more then what I was already making.  Thanks for all you do for me.<br/><br/><strong>Dr. Hasian D. Munky</strong></p>',


    ];
    $('#text-content').loadText( textArray, 10000 ); // ( array, interval )
});
// custom jquery plugin loadText()
$.fn.loadText = function( textArray, interval ) {
    return this.each( function() {
        var obj = $(this);
        obj.fadeOut( 'slow', function() {
            obj.empty().html( random_array( textArray ) );
            obj.fadeIn( 'slow' );
        });
        timeOut = setTimeout( function(){ obj.loadText( textArray, interval )}, interval );
        // reload random text (if not animated) -- entirely optional, can be removed, along with the reload link above (<a href="javascript:;" id="text-reload"><em>randomize</em></a>)
        $("#text-reload").click( function(){
            if( !obj.is(':animated') ) { clearTimeout( timeOut ); obj.loadText( textArray, interval );} // animation check prevents "too much recursion" error in jQuery
        });
    });
}
//public function
function random_array( aArray ) {
    var rand = Math.floor( Math.random() * aArray.length + aArray.length );
    var randArray = aArray[ rand - aArray.length ];
    return randArray;
}